<template>
	<view class="content">
		<div class="pos-rel" v-if="loading">
			<!-- 内容 -->
			<div class="main" :style="{ paddingTop: 2 * navTop + custom.height + custom.top + 10 + 'px' }">

				<div v-for="(item, index) in list" :key="index" class="item mb-16 flex-center" @click="toDetail(item)">
					<div class="icon text-center lh-104 color-fff fontS28">补贴</div>
					<div class="ml-25" style="width: calc(100% - 160upx);">
						<div class="fontS28 olor-0d lh-40 fontE1">{{ item.serveName }}</div>
						<div class="fontS26 color-0d lh-40 fontE1">{{ item.serveIntroduction }}</div>
					</div>
					<div class="ml-auto iconfont icon-youjiantou color-6"></div>
				</div>
			</div>
		</div>
	</view>
</template>

<script>
const App = getApp().globalData;

import {
	findUnFixServeByName,
	findUnFixServeByNameCom
} from "@/api/index";
export default {

	data() {
		return {
			params: {
				pageNum: 1,
				pageSize: 10
			},
			list: [],
			page: '',
			loading: false,
			noteFlag: true

		};
	},
	computed: {
		userInfo() {
			return this.$store.getters.userInfo;
		},
	},
	onReachBottom() {
		this.params.pageNo++;
		if (this.noteFlag) {
			this.getList();
		}
	},


	async onLoad(option) {

		await this.getList()


	},


	methods: {
		// 补贴申领
		async getList() {

			let api = this.userInfo.userType === '03' ? findUnFixServeByNameCom : findUnFixServeByName;
			const {
				rows
			} = await api(this.params);
			this.loading = true
			if (rows.length < this.params.pageSize) this.noteFlag = false
			this.list = [...this.list, ...rows]
		},
		toDetail(item) {
			uni.navigateTo({
				url: `/pages/service/serviceDetail?serveId=${item.serveId}`
			})
		},


	},
};
</script>

<style lang="less" scoped>
page {
	background-color: #f7f7f7 !important;
}

.content {
	height: 100vh;
	overflow-y: auto;


}

.main {
	padding: 30upx;
}

.item {

	background: #fff;
	border-radius: 4px;
	padding: 24upx 30upx;

	.icon {
		min-width: 104upx;
		background: #39B575;
		height: 104upx;
		border-radius: 50%;


	}



}

.slectItem {
	padding: 6px 8px;
	background: #E9F8F0;
	color: #37AF71;
}
</style>